<?php

namespace app\controller;


use app\BaseController;

class Miss extends BaseController
{
    public function miss(){
        return $this->isAjax() ? responseMsg('The page has disappeared', 404) : fetch('/miss/miss', ['mode' => request()->get('mode')], 404);
    }

    public function error(){
        return $this->isAjax() ? responseMsg('Data error', 502) : fetch('/miss/error', ['mode' => request()->get('mode')], 502);
    }

    public function ip(){
        return $this->isAjax() ? responseMsg('The IP has been banned', 502) : fetch('/miss/ip');
    }

    public function auth(){
        return $this->isAjax() ? responseMsg('No permission', 403) : fetch('/miss/auth');
    }

    private function isAjax(): bool
    {
        return request()->isAjax();
    }
}